import dayjs from "dayjs";
const sitemap = {
  path: '/sitemap.xml', //生成的文件路径
  hostname: 'http://www.xiongmaodangao.com', //网站的网址
  cacheTime: 1000 * 60 * 60 * 24, //一天的更新频率，只在generate:false有用
  gzip: true, //生成.xml.gz的sitemap
  generate: false,
  exclude: ['/404'], //排除不要的页面，这里的路径是相对于hostname
  defaults: {
    changefred: 'Always',
    lastmod: dayjs().format('YYYY-MM-DD')
  },
  //   需要生成的xml数据，return 返回需要给出的xml数据
  routes: () => {
    const routes = [{
      url: '',
      priority: 1,
      changefred: 'Always',
    },{
      url: '/cakes',
      priority: 0.9,
      changefred: 'Always',
    },{
      url: '/news',
      priority: 0.9,
      changefred: 'Always',
    },{
      url: 'news/detail/mediaReport/1',
      priority: 0.8,
      changefred: 'Always',
    },{
      url: 'news/detail/mediaReport/2',
      priority: 0.8,
      changefred: 'Always',
    },{
      url: 'news/detail/mediaReport/3',
      priority: 0.8,
      changefred: 'Always',
    },{
      url: 'news/detail/mediaReport/4',
      priority: 0.8,
      changefred: 'Always',
    },{
      url: '/about',
      priority: 0.9,
      changefred: 'Always',
    }]
    routes.forEach(item => {
      item.lastmod = dayjs().format('YYYY-MM-DD')
    })
    return routes;

  },

}
export default sitemap;
